﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WinNemoLib;
using System.Data.SqlClient;
using System.Text;
using System.Data;


   public class Conn
   {
      public  Boolean GetDateTimeDiffCurrent(string d)
      {

         string ConnectionString = Nemo.GetConfiguredDbConnectionWrappertostring("Database");
         SqlConnection cnn = new SqlConnection(ConnectionString);
         StringBuilder str = new StringBuilder();
       
         str.AppendLine("select case when convert(datetime,@d,120) > getdate() then 'true' else 'false' end Cnt");
         SqlCommand cmd = new SqlCommand(str.ToString(), cnn);
         cmd.Connection.Open();
         cmd.CommandType = CommandType.Text;
         cmd.Parameters.Add("@d", SqlDbType.VarChar).Value = d;
         SqlDataAdapter my = new SqlDataAdapter();
         DataSet ds = new DataSet();
         my.SelectCommand = cmd;
         my.Fill(ds);
         return Convert.ToBoolean(ds.Tables[0].Rows[0]["Cnt"].ToString());

      }
   }
